-
-
Notifications
You must be signed in to change notification settings - Fork 0
Add NURBS #24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Add NURBS #24
Conversation
What is NURBS? Can you link a paper? Maybe in a docstring as well? |
abstract type AbstractGlobalCache end | ||
|
||
struct TrivialGlobalCache <: AbstractGlobalCache end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why a global cache instead of a function-local cache?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The cache is local to an interpolation object, it's global in the sense that it is not associated with a particular input dimension. There might be a better name for it.
@@ -56,6 +80,13 @@ function get_output_size(interp::NDInterpolation{N_in}) where {N_in} | |||
size(interp.u)[(N_in + 1):end] | |||
end | |||
|
|||
make_zero(::T) where {T <: Number} = zero(T) | |||
|
|||
function make_zero(v::T) where {T <: AbstractArray} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
function make_zero(v::T) where {T <: AbstractArray} | |
function make_zero!!(v::T) where {T <: AbstractArray} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does this mean? That some methods are mutating and some aren't?
NURBS stands for Non-Uniform Rational Basis Spline. It's a generalization of B-Spline geometries, where a weight is associated with each control point which determines how relatively attractive the control point is. When all weights are the same, the geometry reduces to a B-spline. NURBS are apparently popular in CAD. The weights are used to construct piecewise rational weight functions for the control points, hence the R (which also makes analytical derivatives a pain). Using the weights certain shapes can be represented exactly which can only be approximated by B-Splines, for instance a circle (which is why I use that in a unit test). The Wikipedia page does a pretty good job of introducing the concept, but the go-to source for this subject is The NURBS book. |
Checklist
contributor guidelines, in particular the SciML Style Guide and
COLPRAC.
Additional context
Fixes #16